package Listeners;

import javax.servlet.AsyncEvent;
import javax.servlet.AsyncListener;
import java.io.IOException;

/**
 * Created by hadoop on 17-6-15.
 * 监听异步处理的Servlet
 */
public class MyAsyncListener implements AsyncListener {
    @Override
    public void onComplete(AsyncEvent asyncEvent) throws IOException {
        System.out.println("=====异步调用完成=====");
    }

    @Override
    public void onTimeout(AsyncEvent asyncEvent) throws IOException {
        System.out.println("=====异步调用超时=====");
    }

    @Override
    public void onError(AsyncEvent asyncEvent) throws IOException {
        System.out.println("=====异步调用错误=====");
    }

    @Override
    public void onStartAsync(AsyncEvent asyncEvent) throws IOException {
        System.out.println("=====异步调用开始=====");
    }
}
